﻿<%@ Page Title="" Language="C#" MasterPageFile="~/List.Master" AutoEventWireup="true"
    CodeBehind="HelpList.aspx.cs" Inherits="SGDemo.Permission.HelpList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cpHeader" runat="server">
    <script src="HelpList.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpBody" runat="server">
    <div class="ui-menu">
        <uc:Menu ID="menu1" runat="server" DataFile="../Views/Permission/Menu/HelpList.xml"
            PageCode="HelpList" />
    </div>
    <div class="ui-wrapper">
        <div class="ui-hidden">
            <dx:ASPxLabel ID="lblKeyid" ClientInstanceName="lblKeyid" runat="server" />
        </div>
        <div id="listall" class="ui-content-item ui-content-item-selected">
            <table>
                <tr>
                    <td style="vertical-align: top; width: 200px">
                        <dx:ASPxTreeList ID="tlList" Width="100%" ClientInstanceName="tlList" KeyFieldName="Keyid"
                            ParentFieldName="ParentKeyid" OnCustomCallback="tlList_CustomCallback" runat="server"
                            DataSourceID="tlListOdlist">
                            <Columns>
                                <dx:TreeListDataColumn FieldName="Keyid" Visible="false" />
                                <dx:TreeListDataColumn FieldName="ParentKeyid" Visible="false" />
                                <dx:TreeListDataColumn FieldName="HelpCategoryName" VisibleIndex="1" Caption="帮助类别" />
                            </Columns>
                            <ClientSideEvents NodeDblClick="doSelectKeyid" />
                            <SettingsPager Mode="ShowAllNodes" />
                            <Styles>
                                <PagerTopPanel>
                                    <BorderBottom BorderStyle="Solid" />
                                </PagerTopPanel>
                                <PagerBottomPanel>
                                    <BorderTop BorderStyle="Solid" />
                                </PagerBottomPanel>
                                <AlternatingNode Enabled="true" />
                            </Styles>
                            <Settings GridLines="Both" />
                            <SettingsBehavior AllowFocusedNode="true" AutoExpandAllNodes="true" />
                            <SettingsLoadingPanel Text="加载中..." />
                        </dx:ASPxTreeList>
                        <%--数据源控件--%>
                         <asp:ObjectDataSource ID="tlListOdlist" runat="server" TypeName="SGDemo.Permission.HelpCategoryListDateSource"
                            SelectMethod="FilteredGetAll">
                            <SelectParameters>
                                <asp:ControlParameter Name="filterConditions" Type="String" ControlID="hfFilter"
                                    PropertyName="Value" ConvertEmptyStringToNull="false" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                        <%--存储过滤条件--%>
                        <asp:HiddenField ID="hfFilter" ClientIDMode="Static" runat="server" Value=" " />
                        <%--GridView数据导出--%>
                        <dx:ASPxGridViewExporter ID="gvweList" GridViewID="gvwList" runat="server" PaperName="Ralph"
                            FileName="文档列表">
                        </dx:ASPxGridViewExporter>
                    </td>
                    <td style="width: 10px">
                    </td>
                    <td style="vertical-align: top;">
                        <%--gvwList--%>
                        <dx:ASPxGridView ID="gvwList" ClientInstanceName="gvwList" runat="server" AutoGenerateColumns="False" DataSourceID="odsList"
                            DataSourceForceStandardPaging="True" Width="700px" KeyFieldName="Keyid" OnCustomCallback="gvwList_CustomCallback">
                              <Columns>
                                <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" Caption="选择"
                                    HeaderStyle-HorizontalAlign="Center">
                                </dx:GridViewCommandColumn>
                                <dx:GridViewDataColumn Caption="编码" FieldName="HelpCode" VisibleIndex="1">
                                </dx:GridViewDataColumn>
                                <dx:GridViewDataColumn Caption="标题" VisibleIndex="2" Width="260">
                                    <DataItemTemplate>
                                        <%# Eval("Title").ToString().Length >= 20 ? Eval("Title").ToString().Substring(0, 20) + "..." : Eval("Title")%>
                                    </DataItemTemplate>
                                </dx:GridViewDataColumn>
                                <dx:GridViewDataColumn Caption="内容" VisibleIndex="3" Width="260">
                                    <DataItemTemplate>
                                        <%# Eval("Body").ToString().Length >= 20 ? Eval("Body").ToString().Substring(0, 20) + "..." : Eval("Body")%>
                                    </DataItemTemplate>
                                </dx:GridViewDataColumn>
                                <dx:GridViewDataColumn Caption="备注" FieldName="Remark" VisibleIndex="4">
                                </dx:GridViewDataColumn>
                            </Columns>
                            <ClientSideEvents SelectionChanged="doSelectionChanged" RowDblClick="doRowDblClick" />
                            <SettingsBehavior AllowFocusedRow="true" AllowGroup="true" AutoExpandAllGroups="true" />
                            <SettingsLoadingPanel Text="加载中..." />
                            <SettingsPager PageSize="15" Mode="ShowPager" Summary-Text="当前第{0}页，共{1}页(共{2}条)">
                            </SettingsPager>
                            <SettingsText EmptyDataRow="没有数据显示" />
                            <Styles>
                                <AlternatingRow Enabled="True" />
                            </Styles>
                        </dx:ASPxGridView>
                        <%--数据源控件--%>
                         <asp:ObjectDataSource ID="odsList" runat="server" SortParameterName="sortColumns"
                            EnablePaging="true" StartRowIndexParameterName="startRecord" MaximumRowsParameterName="maxRecords"
                            SelectCountMethod="PagingGetHelpCount" SelectMethod="PagingGetHelp" TypeName="SGDemo.Permission.HelpListDataSource">
                            <SelectParameters>
                                <asp:ControlParameter Name="filterConditions" Type="String" ControlID="hfFilterCondition"
                                    PropertyName="Value" ConvertEmptyStringToNull="false" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                        <%--存储过滤条件--%>
                        <asp:HiddenField ID="hfFilterCondition" ClientIDMode="Static" runat="server" Value="1=2" />
                        <%--TreeList数据导出--%>
                        <dx:ASPxTreeListExporter ID="tleList" runat="server" TreeListID="tlList" FileName="文档列表">
                        </dx:ASPxTreeListExporter>
                    </td>
                </tr>
            </table>
        </div>
        <div id="search" class="ui-content-item">
            <ul class="ui-list">
                <li>
                    <dx:ASPxLabel ID="lblTitle" runat="server" Text="标题：" AssociatedControlID="txtTitleText" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="txtTitleText" ClientInstanceName="txtTitleText" runat="server"
                        Width="120px">
                    </dx:ASPxTextBox>
                </li>
                <li>
                    <dx:ASPxLabel ID="lblNoticeObject" runat="server" Text="文档对象：" AssociatedControlID="txtNoticeObjectText" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="txtNoticeObjectText" ClientInstanceName="txtNoticeObjectText"
                        runat="server" Width="120px">
                    </dx:ASPxTextBox>
                </li>
                <li>
                    <dx:ASPxLabel ID="lblPublishDate" runat="server" Text="发布日期：" AssociatedControlID="dePublishDate" />
                </li>
                <li>
                    <dx:ASPxDateEdit ID="dePublishDate" ClientInstanceName="dePublishDate" runat="server"
                        Width="120px" EditFormatString="yyyy-MM-dd">
                    </dx:ASPxDateEdit>
                </li>
            </ul>
            <ul class="sl-floatcenter clearfix">
                <li class="sl-floatcenter-item">
                    <dx:ASPxButton ID="btnSubmit" ClientInstanceName="btnSubmit" runat="server" Text="查 询"
                        AutoPostBack="false">
                        <ClientSideEvents Click="doSubmittedToSearch" />
                    </dx:ASPxButton>
                </li>
                <li class="sl-floatcenter-item">
                    <dx:ASPxButton ID="btnReset" ClientInstanceName="btnReset" runat="server" Text="重 置"
                        AutoPostBack="false">
                        <ClientSideEvents Click="doResetToSearch" />
                    </dx:ASPxButton>
                </li>
            </ul>
        </div>
    </div>
</asp:Content>
